﻿import aop = require("../../kf/aop");
import clientApp = require("../../kf/client/clientApp");

@aop.addon("app布局视图", "app布局视图", clientApp.moduleName)
export class applayoutView extends aop.baseObject implements clientApp.viewObject {
    bindingHandler?(data: any): any {
        var viewModel = {
            navs: [
                {
                    title: "首页",
                    onExcute: "#home/home1",
                    icon: "home",
                    iconClass: "glyphicon glyphicon-home"
                },
                {
                    title: "贷款",
                    onExcute: "#",
                    icon: "usd",
                    iconClass: "glyphicon glyphicon-usd"
                },
                {
                    title: "我",
                    onExcute: "#about/about1",
                    icon: "user",
                    iconClass: "glyphicon glyphicon-user"
                }
            ],
            changeTitle: function (nav:any) {
                let title: string = nav.title;
                var titleModel = {
                    title: title
                };
                clientApp.applyBindings(titleModel, $("#title")[0]);
                return true;
            }
        };
        clientApp.applyBindings(viewModel, $("#nav")[0]);
    }
}
